const express = require("express");

const app = express();
// 添加中间件
// 添加跨域模块
app.use(require("cors")());
app.use(express.json());

// 静态文件托管
app.use('/uploads',express.static(__dirname + '/uploads'))

// 直接执行函数并传入app作为参数
require("./plugins/db")(app);
require("./routes/admin")(app);

app.listen(3000, () => {
  console.log("http://localhost:3000");
});